package com.example.ibsp_demo.pojo.entity.content;

import java.time.LocalDateTime;

public class Comment {

    private Integer commentId;      // 评论ID
    private Integer ctid;           // 内容ID
    private Integer parentId;       // 父评论ID（可为空）
    private Integer commenterId;    // 评论者ID
    private String content;         // 评论内容
    private LocalDateTime createTime; // 评论时间
    private Integer likeCount;      // 新增：点赞数

    // 无参构造
    public Comment() {
    }

    // 有参构造
    public Comment(Integer commentId, Integer ctid, Integer parentId,
                   Integer commenterId, String content, LocalDateTime createTime,
                   Integer likeCount) {
        this.commentId = commentId;
        this.ctid = ctid;
        this.parentId = parentId;
        this.commenterId = commenterId;
        this.content = content;
        this.createTime = createTime;
        this.likeCount = likeCount;
    }

    // Getter and Setter

    public Integer getCommentId() {
        return commentId;
    }

    public void setCommentId(Integer commentId) {
        this.commentId = commentId;
    }

    public Integer getCtid() {
        return ctid;
    }

    public void setCtid(Integer ctid) {
        this.ctid = ctid;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getCommenterId() {
        return commenterId;
    }

    public void setCommenterId(Integer commenterId) {
        this.commenterId = commenterId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    // toString 方法
    @Override
    public String toString() {
        return "TComment{" +
                "commentId=" + commentId +
                ", ctid=" + ctid +
                ", parentId=" + parentId +
                ", commenterId=" + commenterId +
                ", content='" + content + '\'' +
                ", createTime=" + createTime +
                ", likeCount=" + likeCount +
                '}';
    }
}